<?php
class SettingController extends AdminController{
    public function siteAction(){
        $option = Request::asget(6,'option','');
        if($option == ''){
            return true;
        }else{
            $site = new SiteModel;
            $data['site'] = $site->where(['options'=>$option])->one();
            Yaf_Dispatcher::getInstance()->disableView();
            $this->_view->site = $data;
            $this->display('site-edit',$data);
        }
                                 
    }
    
    public function insertAction(){
        Yaf_Dispatcher::getInstance()->disableView();
        $option = Request::aspost(6,'option');
        $data['title'] = Request::aspost(6,'title','');
        $data['keyword'] = Request::aspost(6,'keyword','');
        $data['logo'] = Request::aspost(6,'logo','');
        $data['description'] = Request::aspost(6,'description','');
        $data['copyright'] = Request::aspost(6,'copyright','');
        $data['ipc'] = Request::aspost(6,'ipc','');
        $values = json_encode($data);
        $data = [];
        $data['values'] = $values;
        $data['option'] = $sign;
        $site = new SiteModel;
        $flag = $site->insert($data);
        if($flag == false){
            Response::error('wrong');
        }else{
            Response::success('nice');
        }

    }
}